<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@ page import="com.augmentum.oes.util.PropertyUtil" %>
<%@ page import="com.augmentum.oes.util.PathUtil" %>
<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Edit Question</title>
    <link rel="stylesheet" href="<%=PropertyUtil.getStaticPath() %>/static/css/main.css" type="text/css" />
    <link rel="stylesheet" href="<%=PropertyUtil.getStaticPath() %>/static/css/question.css" type="text/css" />
    <link rel="stylesheet" href="<%=PropertyUtil.getStaticPath() %>/static/css/divtable.css" type="text/css" />
    <script src="<%=PropertyUtil.getStaticPath() %>/static/js/jquery-1.10.2.min.js"></script>
    <script src="<%=PropertyUtil.getStaticPath() %>/static/js/dialog.js"></script>
    <script src="<%=PropertyUtil.getStaticPath() %>/static/js/question.js"></script>
  </head>
  <body>
    <div class="header">
      <div class="logo-icon">
      </div>
      <div class="head-title">
        Online Exam System
      </div>
      <div class="user-logout">
      <div class="language">
              中文
      </div>
      <div class="person-info-outdiv">
        <div onclick="javascript:window.location.href='<%=PathUtil.getFullPath("userdetail.action")%>'" class="person-info-inner float-left"><div class="person-info-inner">
          <img src="<%=PropertyUtil.getStaticPath() %>/static/images/ICN_Web_PersonalInformation_20x20.png" class="person-info-currentpage">
        </div>
          <span >${USER.userName}</span></div>
          <div class="logout1" onclick="javascript:window.location.href='../static/logout.jsp'">Logout</div>
       </div>
      </div>
    </div>
    <div class="tab-panel"> 
      <div class="question-manage active" onclick="toQuestionList();">
        Question Management
      </div>
      <div class="exam-manage" onClick="toExamList();" style="margin-left:119.1px;">
        Exam Management
      </div>
    </div>
    <div class="breadcrumb"><a onclick="toQuestionList();" class="cursor">Question Management</a> > <a onclick="toQuestionList();" class="cursor">Question List</a> > <label >QT000${QUESTION.id}</label></div>
    <div class="content-panel content-panel-breadcrumb">
      <div class="content-empty-panel">
       
            <form action="editquestion.action"  method="POST" id="updateQuestionForm" >
            <div class="form-body">
              <div class="questionid">
                <div class="questionid-title">Question ID:
                </div>
               <div class="questionid-input"><input type="text" disabled value="QT000${QUESTION.id}" />
                </div>
              </div>
              <div class="question">
                <div class="question-title">Question:
                </div>
                 <div class="question-input">
                  <textarea class="text-area" onblur="recheckForm();" id="question" name="question" >${QUESTION.question}</textarea>
                </div>
                <div class="error-div line-height"  id="questionError"></div>
                </div>
             <div class="answer">
               <div class="answer-title">Answer:
                </div>
                <input type="hidden" value="${QUESTION.id }" name="qid" />
               <div class="answer-input">
                    <div><input name="answer_radio" onchange="checkRadio();" type="radio" value="A" <c:if test="${QUESTION.answer eq 1}" >checked="checked" class="rightAnswer" </c:if> >A<input id="ansa" name="answer" onblur="recheckForm();" type="text" value="${QUESTION.answerA}"></div>
                    <div><input name="answer_radio" onchange="checkRadio();" type="radio" value="B" <c:if test="${QUESTION.answer eq 2}" >checked="checked" class="rightAnswer"</c:if> >B<input id="ansb" name="answer" onblur="recheckForm();" type="text" value="${QUESTION.answerB}"></div>
                    <div><input name="answer_radio" onchange="checkRadio();" type="radio" value="C" <c:if test="${QUESTION.answer eq 3}" >checked="checked" class="rightAnswer"</c:if> >C<input id="ansc" name="answer" onblur="recheckForm();" type="text" value="${QUESTION.answerC}"></div>
                    <div><input name="answer_radio" onchange="checkRadio();" type="radio" value="D" <c:if test="${QUESTION.answer eq 4}" >checked="checked" class="rightAnswer"</c:if> >D<input id="ansd" name="answer" onblur="recheckForm();" type="text" value="${QUESTION.answerD}"></div>
                </div>
                <div class="error-div line-height" id="answerError"></div>
                </div>
                <div class="edit-outdiv">
                     <div class="edit-button" onclick="submitUpdateForm();" onmouseout="this.className='edit-button'" onmouseover="this.className='edit-button-over'" style="float:left;">
                       Edit
                     </div>
                     <div class="edit-button" onclick="toQuestionList()" onmouseout="this.className='edit-button'" onmouseover="this.className='edit-button-over'" style="float:right;">
                       Cancel
                </div>
              </div>
             </div>
            </form>
      </div>
    </div>
    <div class="footer">
      <p> Copyright © 2014 Augmentum, Inc.All Rights Reserved.</p>
    </div>
    <div class="modal-dialog" id="modalDialog">
      <div onclick="modalDialogHidden();" title="Close Dialog" class="modal-dialog-closebutton"></div>
      <div class="modal-dialog-msg"></div>
      <div class="modal-dialog-btn-outdiv">
        <div class="modal-btn modal-dialog-btn-yes">Yes</div>
        <div class="modal-btn modal-dialog-btn-no">No</div>
      </div>
    </div>
    <div class="modal-div" id="modalDiv"></div>
  </body>
</html>